﻿using LibQuestionIsPhone.Models;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace InterviewAppPhone.ViewModels
{
    public abstract class BaseViewModel : INotifyPropertyChanged
    {
        public static ObservableCollection<TipologiaTest> Tipologie { get; set; }


        private bool _isConnection;

        public bool IsConnection
        {
            get { return _isConnection; }
            set
            {
                _isConnection = value;
                OnPropertyChanged("IsConnection");
                OnPropertyChanged("IsAssenzaRete");
            }
        }

        private string _testoErrore;

        public string TestoErrore
        {
            get { return _testoErrore; }
            set
            {
                _testoErrore = value;
                OnPropertyChanged("TestoErrore");
            }
        }


        public bool IsAssenzaRete
        {
            get { return !IsConnection; }
        }

        private bool _isCalculate { get; set; }
        public bool IsCalculate
        {
            get { return _isCalculate; }
            set
            {
                _isCalculate = value;
                OnPropertyChanged("IsCalculate");
            }
        }

        //   private bool _isDataLoaded { get; set; }

        public bool IsDataLoaded
        {
            get { return DataFlowObject.IsDatiCaricati; }
            set
            {
                DataFlowObject.IsDatiCaricati = value;
                OnPropertyChanged("IsDataLoaded");
            }
        }

        public virtual event PropertyChangedEventHandler PropertyChanged;

        public abstract void OnPropertyChanged(string propertyName);
    }
}
